let versionData = require('../../static/version.json');
import router from '../../src/router'
const isNewVersion = () => {
  let version = versionData.version;
  let localVersion = localStorage.getItem('version');
  if (localVersion && localVersion != version) {
    if (confirm("系统检测到有新版本，是否更新？")) {
      localStorage.setItem('version', versionData.version);
      window.localStorage.clear();
      router.push('/');
      return;
    }
  }else {
    localStorage.setItem('version',versionData.version);
  }
};
export default {
  isNewVersion
}
